/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.javacommunity.model.dao;

import com.javacommunity.model.entity.Question;
import java.util.List;

/**
 *
 * @author Pham
 */
public interface QuestionDAO {

    Question getQuestionById(int quesId);

    /**
     *
     * @param param condition get Questions
     * @return
     * if(param = 1) then return all listOfQuestion with active = true
     * else if(param = 0) then return all listOfQuestion with active = false
     * else return All Question from DB
     */
    List<Question> getQuestions(int param);

     /**
     * Get Question pagination
     * @param firstRow get First row
     * @param rowCount get row number
     * @param param condition for getListOfQuestion
     * if param = "votes" => get order by votes desc
     * else if param = "enable" => get Question active = true
     * else if param = "disable" => get Question active = false
     * else if param = "all" => get All Question
     * @return List's of Question
     */
    List<Question> getListOfQuestion(int firstRow, int rowCount, String param);
    
    List<Question> getQuestionByName(String name);

    boolean checkExistQuestion(String questionName);
    
    boolean createQuestion(Question question);
    
    boolean updateQuestion(Question question);

    public boolean updateViewCount(Question question);

    boolean deleteQuestion(Question question);

    boolean restoreQuestion(Question question);

    boolean removeQuestion(Question question);
}
